<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8" />
  <title>opencpn:opencpn_user_manual:getting_started:help_fix_bugs</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="opencpn,opencpn_user_manual,getting_started,help_fix_bugs"/>
<link rel="search" type="application/opensearchdescription+xml" href="../lib/exe/opensearch.html" title="OpenCPN Manuals"/>
<link rel="start" href="help_fix_bugs.html"/>
<link rel="contents" href="help_fix_bugs.html" title="Sitemap"/>
<link rel="alternate" type="application/rss+xml" title="Recent Changes" />
<link rel="alternate" type="application/rss+xml" title="Current namespace" />
<link rel="alternate" type="text/html" title="Plain HTML" href="help_fix_bugs.html"/>
<link rel="alternate" type="text/plain" title="Wiki Markup" href="help_fix_bugs.html"/>
<link rel="canonical" href="http://localhost/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:help_fix_bugs"/>
<link rel="stylesheet" type="text/css" href="../lib/exe/css.php.t.bootstrap3.css"/>
<!--[if gte IE 9]><!-->
<script type="text/javascript">/*<![CDATA[*/var NS='opencpn:opencpn_user_manual:getting_started';var JSINFO = {"id":"opencpn:opencpn_user_manual:getting_started:help_fix_bugs","namespace":"opencpn:opencpn_user_manual:getting_started","confirm_delete":"Are you sure you want to delete this page?","doku_base":"\/dokuwiki\/","cg_rev":"","dw_version":49.5,"chrome_version":0,"hide_captcha_error":"none","ckg_dbl_click":"","ckg_canonical":0,"has_wrap":"Wrap","wrapDiv":"WRAP","wrapSpan":"wrap","ckgEdPaste":"off","rel_links":0,"isadmin":0,"isauth":0,"move_renameokay":false,"schemes":["http","https","telnet","gopher","wais","ftp","ed2k","irc","ldap"],"htmlok":0};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="../lib/exe/jquery.php.t.bootstrap3.js"></script>
<script type="text/javascript" charset="utf-8" src="../lib/exe/js.php.t.bootstrap3.js"></script>
<!--<![endif]-->

    <script type="text/javascript">
    //<![CDATA[ 
    function LoadScript( url )
    {
     document.write( '<scr' + 'ipt type="text/javascript" src="..//url"><\/scr' + 'ipt>' ) ;        

    }
   function LoadScriptDefer( url )
    {
     document.write( '<scr' + 'ipt type="text/javascript" src="..//url" defer><\/scr' + 'ipt>' ) ;        

    }
//]]> 

 </script>
</head>
<body>
<div class="dokuwiki export">



<h1 class="sectionedit1" id="help_fix_bugs">Help Fix Bugs!</h1>
<div class="level1">

<p>
If you experience a crash in OpenCPN, the developers are very keen on knowing why. This is how you can help making OpenCPN, even better.
</p>

</div>
<!-- EDIT1 SECTION "Help Fix Bugs!" [20-187] -->
<h2 class="sectionedit2" id="windows">Windows</h2>
<div class="level2">

<p>
In OpenCPN ver 4.0 the semi-automatic Crash reporting for Windows is disabled by default.<br/>

Crash Reports are saved in the OpenCPN config directory, i.e. where the log file is stored now. End users may occasionally be asked privately to send these reports to a designated recipient.<br/>

<br/>

The semi-automatic Crash reporting can be enabled by editing the opencpn.ini file.<br/>

</p>
<pre class="code">[Settings] …..
EmailCrashReport=1</pre>

<p>
<strong>Here is what you will see if OpenCPN causes a crash with the crashreport enabled.</strong> <br/>

<br/>

<img src="../opencpn/manual/werror1.h.293_tok.8a028d_w.496.jpg" class="media" alt="" width="496" height="293" />
<br/>

Provide additional information, such as your email or forum name, so the developers can contact you for more info, if necessary.<br/>

<br/>

<img src="../opencpn/manual/werror2.h.382_tok.e5dd0b_w.491.jpg" class="media" alt="" width="491" height="382" /><br/>

<br/>

This is what the report will contain. Use the “Export” button if yoy don&#039;t have an Internet connection at the time of the crash. Mail the report later.<br/>

<br/>

<img src="../opencpn/manual/werror3.h.404_tok.984e50_w.442.jpg" class="media" alt="" width="442" height="404" />
</p>
<div class="table sectionedit3"><table class="inline">
	<tr class="row0">
		<td class="col0">Also, for fun, you may test this option by the keystroke Alt-F12. This will induce a benign crash, and give you a chance to see what it will look like before the real thing happens. <br/>
Please don&#039;t send this kind of report by pressing “Send report”. Just press “Close the program” when you are done. Restart OpenCPN! <br/>
<em><strong>This feature is temporary and will not be available in the Beta Release following 3.3.814.</strong> </em> </td>
	</tr>
</table></div>
<!-- EDIT3 TABLE [1163-1585] -->
</div>
<!-- EDIT2 SECTION "Windows" [188-1586] -->
<h2 class="sectionedit4" id="linux">Linux</h2>
<div class="level2">

<p>
<br/>

In Linux there is an excellent tool, “ddd”, the Data Display Debugger, to help the developers pinpoint where an error, or bug, is located in the source code. “ddd” is a graphical front-end to the text based “gdb”, the GNU debugger.<br/>

<br/>

Install ddd through Synaptic, Ubuntu Software Center or similar for other Linux distributions.<br/>

From a command line, in a Debian based Linux, such as Ubuntu, issue this command:<br/>

$sudo apt-get install ddd
</p>
<ul>
<li class="level1"><div class="li"> The “$” sign above, just marks that this is a command line for a normal user. Do not include it in the actual command. This is a Linux convention used everywhere.</div>
</li>
</ul>

</div>

<h4 id="start_ddd">Start ddd</h4>
<div class="level4">

<p>
To start ddd, find a command-line and <br/>
$ddd opencpn <br/>
 <br/>
ddd starts and this is what you will see. <br/>

</p>

<p>
<img src="../opencpn/manual/ddd1.tok.ad29dc_w.750.jpg" class="media" alt="" width="750" /> <br/>

</p>

<p>
Click “Run”. If you don&#039;t get this small dialog, go to Program → Run, or hit F2 <br/>
This will start OpenCPN. Just continue in OpenCPN and proceed to create a crash. <br/>
Then go back to the ddd window. <br/>
This is how it will look like after a crash. <br/>

</p>

<p>
<img src="../opencpn/manual/ddd2.tok.d45d1a_w.750.jpg" class="media" alt="" width="750" />
</p>

<p>
 <br/>
 <br/>
Notice “Program received signal SIGSEGV, Segmentation fault.” <br/>
This is programmers way of saying a “crash”. Exactly what this means, does not matter for a normal user. Interested anyway? Read more, <a href="http://en.wikipedia.org/wiki/Segmentation_fault" class="urlextern" title="http://en.wikipedia.org/wiki/Segmentation_fault" rel="nofollow">http://en.wikipedia.org/wiki/Segmentation_fault</a> <br/>

To actually help the developers we need a back trace from the crash. This is the path that the program followed in the source code, leading to the crash. <br/>

</p>

<p>
<img src="../opencpn/manual/ddd3.tok.55e84f_w.750.jpg" class="media" alt="" width="750" />
</p>

<p>
 <br/>
Go to Status → Backtrace. <br/>
This is what comes up, from this particular crash. <br/>
 <br/>
<img src="../opencpn/manual/ddd4.tok.d8d761_w.750.jpg" class="media" alt="" width="750" /> <br/>
The crash happened at #0 and this very short back trace started at #9. <br/>
Your job now is to take a screen-dump, similar to the picture above, and send it on. <br/>
Try to get as much of the back trace as possible, by expanding the Back trace dialog. <br/>
This is important, so the developers can see the trouble point in the source code. <br/>
Look at #3 above, ending in “….chart1.cpp:2367”. “chart1.cpp” is a part of the OpenCPN source code, and something on line 2367 was involved, directly or indirectly in the crash. <br/>
Lines ending in “……… .so.0” are external libraries used to run OpenCPN. <br/>
 <br/>
On the odd occasion, when the back trace is very long, the developers may still complain that they need to see more.
</p>

</div>

<h4 id="using_gdb">Using gdb</h4>
<div class="level4">

<p>
Gdb, the command line debugger, is the answer. <br/>
Start like this <br/>
$gdb opencpn <br/>
Gdb starts and you get the gdb command prompt (gdb). <br/>
Just type “r”, for run and hit Enter. Like this: <br/>
(gdb) r <br/>
 <br/>
OpenCPN will now start, once again, make it crash. <br/>
The console will look similar to below. <br/>

</p>

<p>
<img src="../opencpn/manual/gdb.tok.5bdf50_w.750.jpg" class="media" alt="" width="750" />
</p>

<p>
 <br/>
All the lines before the “Segmentation fault” line, are just “chatter” from PortAudio and Gdk, and are not directly related to OpenCPN. <br/>
 <br/>
To get a back trace, simply <br/>
(gdb)bt <br/>
That is type “bt”, for back trace, and hit enter. <br/>

</p>

<p>
<img src="../opencpn/manual/gdb1.tok.6809f1_w.750.jpg" class="media" alt="" width="750" />
</p>

<p>
 <br/>
 <br/>
You will now have access to the full back trace, with more details and reverse order to “ddd”. <br/>
Copy the text, and send it on. <br/>
Press “q” to exit gdb. <br/>
 <br/>
<strong>Send it on to the Programmers</strong> <br/>
Tell the programmers about your findings through an entry in the tracker <a href="https://opencpn.org/flyspray/" class="urlextern" title="https://opencpn.org/flyspray/" rel="nofollow">https://opencpn.org/flyspray/</a> , or through posting on the forum <a href="http://www.cruisersforum.com/forums/f134" class="urlextern" title="http://www.cruisersforum.com/forums/f134" rel="nofollow">http://www.cruisersforum.com/forums/f134</a> , if you have found a new bug.
</p>

</div>
<!-- EDIT4 SECTION "Linux" [1587-] -->
<!-- no cachefile used, but created /var/www/html/dokuwiki/data/cache/e/e95722dfba96cf44273880171cb6851a.xhtml -->
</div>
</body>
</html>
